c	Created: Friday, September 27, 1991 10:04:39 AM
c	 ImageCodec.f
c	 FORTRAN Interface to the Macintosh Libraries

c	 Copyright Apple Computer, Inc. 1991
c	 All rights reserved
	
	
	
!!IFC Not UsingIncludes
!!I Zeroinc.f
!!ENDC
!!IFC Not GotQuickDraw
!!I QuickDraw.f
!!ENDC
!!IFC NOt GotQDOffscreen
!!I QDOffscreen.f
!!ENDC
	
!!IFC Not GotTypes
!!I Types.f
!!ENDC
	
!!IFC Not GotComponents
!!I Components.f
!!ENDC
	
!!IFC not GotImageCompression
!!I ImageCompression.f
!!ENDC

!!IFC NOT GOTIMAGECODEC
!!SETC GOTIMAGECODEC = true
		
	!	codec component selectors	
	!	codec selectors 0-127 are reserved by Apple 
	!	codec selectors 128-191 are subtype specific 
	!	codec selectors 192-255 are vendor specific 
	! 	codec selectors 256-32767 are reserved by Apple 
	!	negative selectors are reserved by the Component Manager 
	
	Integer*2*2 codecGetCodecInfo					
	Integer*2*2 codecGetCompressionTime				
	Integer*2*2 codecGetMaxCompressionSize			
	Integer*2*2 codecPreCompress					
	Integer*2*2 codecBandCompress					
	Integer*2*2 codecPreDecompress					
	Integer*2*2 codecBandDecompress					
	Integer*2*2 codecCDSequenceBusy					
	Integer*2*2 codecGetCompressedImageSize			
	Integer*2*2 codecGetSimilarity					
	Integer*2*2 codecTrimImage						
	Integer*2*2 codecGetCodecInfo					
	Integer*2*2 codecGetCompressionTime				
	Integer*2*2 codecGetMaxCompressionSize			
	Parameter (codecPreCompress				= $03)
	Parameter (codecBandCompress			= $04)
	Parameter (codecPreDecompress			= $05)
	Parameter (codecBandDecompress			= $06)
	Parameter (codecCDSequenceBusy			= $07)
	Parameter (codecGetCompressedImageSize	= $08)
	Parameter (codecGetSimilarity			= $09)
	Parameter (codecTrimImage				= $0a)
	
	
	!	codec capabilities flags	
	
	Integer*2*2 codecCanScale						
	Integer*2*2 codecCanMask						
	Integer*2*2 codecCanMatte						
	Integer*2*2 codecCanTransform					
	Integer*2*2 codecCanTransferMode				
	Integer*2*2 codecCanCopyPrev					
	Integer*2*2 codecCanSpool						
	Integer*2*2 codecCanClipVertical				
	Integer*2*2 codecCanClipRectangular				
	Integer*2*2 codecCanRemapColor					
	Integer*2*2 codecCanFastDither					
	Integer*2*2 codecCanSrcExtract					
	Integer*2*2 codecCanCopyPrevComp				
	Integer*2*2 codecCanAsync						
	Integer*2*2 codecCanMakeMask					
	Integer*2*2 codecCanShift						
	Parameter (codecCanScale			= $1)
	Parameter (codecCanMask				= $2)
	Parameter (codecCanMatte			= $4)
	Parameter (codecCanTransform		= $8)
	Parameter (codecCanTransferMode		= $10)
	Parameter (codecCanCopyPrev			= $20)
	Parameter (codecCanSpool			= $40)
	Parameter (codecCanClipVertical		= $80)
	Parameter (codecCanClipRectangular	= $100)
	Parameter (codecCanRemapColor		= $200)
	Parameter (codecCanFastDither		= $400)
	Parameter (codecCanSrcExtract		= $800)
	Parameter (codecCanCopyPrevComp		= $1000)
	Parameter (codecCanAsync			= $2000)
	Parameter (codecCanMakeMask			= $4000)
	Parameter (codecCanShift			= $8000)
	
	
	
	Integer*2*4 codecConditionFirstBand				
	Integer*2*4 codecConditionLastBand				
	Integer*2*4 codecConditionCodecChangedMask		
	Parameter (codecConditionFirstBand			= $1)
	Parameter (codecConditionLastBand			= $2)
	Parameter (codecConditionCodecChangedMask	= $80000000)
	
	
	
	Character*4 codecInfoResourceType	
	Parameter (codecInfoResourceType = 'cdci')	! codec info resource type 
	
	Structure /CodecCapabilities /
		Integer*4 flags
		Integer*2 wantedPixelSize	
		Integer*2 extendWidth
		Integer*2 extendHeight
		Integer*2 bandMin
		Integer*2 bandInc
		Integer*2 pad
		Integer*2 time
	End Structure
	Structure /CodecCapabilitiesPtr /
		Pointer /CodecCapabilities/ P
	End Structure
	
	Structure /CodecCompressParams /
		Record /ImageSequence/  sequenceID 						! precompress,bandcompress 
		Record /ImageDescriptionHandle/ imageDescription 		! precompress,bandcompress 
		Record /Ptr/ data  
		Integer*4 bufferSize  
		Integer*4 frameNumber 
		Integer*4 startLine 
		Integer*4 stopLine 
		Integer*4 conditionFlags 
		Record /CodecFlags/ callerFlags  
		Record /CodecCapabilitiesPtr/ capabilities 			! precompress,bandcompress   
		Record /ProgressProcRecord/ progressProcRecord  
		Record /CompletionProcRecord/ completionProcRecord  	
		Record /FlushProcRecord/ flushProcRecord  
		Record /PixMap/ srcPixMap  								! precompress,bandcompress 
		Record /PixMap/ prevPixMap  
		Record /CodecQ/ spatialQuality  
		Record /CodecQ/ temporalQuality  
		Integer*4 similarity  
		Integer*4 reserved(0:1)
	End Structure
	Structure /CodecCompressParamsPtr /
		Pointer /CodecCompressParams/ P
	End Structure
	
	Structure /CodecDecompressParams /
		Record /ImageSequence/ sequenceID  						! predecompress,banddecompress 
		Record /ImageDescriptionHandle/ imageDescription  		! predecompress,banddecompress 
		Record /Ptr/ data  
		Integer*4 bufferSize  
		Integer*4 frameNumber  
		Integer*4 startLine  
		Integer*4 stopLine  
		Integer*4 conditionFlags  
		Record /CodecFlags/ callerFlags  
		Record /CodecCapabilitiesPtr/ capabilities  			! predecompress,banddecompress 
		Record /ProgressProcRecord/ progressProcRecord  
		Record /CompletionProcRecord/ completionProcRecord  
		Record /DataProcRecord/ dataProcRecord  
		Record /CGrafPtr/ port  								! predecompress,banddecompress 
		Record /PixMap/ dstPixMap  								! predecompress,banddecompress 
		Record /BitMapPtr/ maskBits  
		Record /PixMapPtr/ mattePixMap  
		Record /Rect/ srcRect  									! predecompress,banddecompress 
		Record /MatrixRecordPtr/ matrix  						! predecompress,banddecompress 
		Record /CodecQ/ accuracy  								! predecompress,banddecompress 
		Integer*2 transferMode  							! predecompress,banddecompress 
		Integer*4 reserved(0:1) 				
	End Structure
	Structure /CodecDecompressParamsPtr /
		Pointer /CodecDecompressParams/ P
	End Structure
	
!!ENDC ! GOTImageCodec 
	